import React from 'react'
//App 父组件   Son子组件
function SonF(props) {
  const { list } = props.state
  return (
    <>
      <div>我是函数子组件,{props.msg}</div>
      <ul>
        {list.map((o) => (
          <li>{o}</li>
        ))}
      </ul>
    </>
  )
}
class SonC extends React.Component {
  render() {
    return <div>我是类子组件,{this.props.msg}</div>
  }
}
class App extends React.Component {
  state = {
    message: 'this is message',
    list: [1, 2, 3],
  }
  render() {
    return (
      <div>
        <SonF msg={this.state.message} state={this.state}></SonF>
        <SonC msg={this.state.message}></SonC>
      </div>
    )
  }
}

export default App
